const getToken = () => {
    return localStorage.getItem("token");
}

const setToken = (token) => {
    localStorage.setItem("token",token);
}

const removeToken = () => {
    localStorage.removeItem("token");
}

const getUser = () => {
    const userStr = localStorage.getItem("user");
    return JSON.parse(userStr);
}

const setUser = (userObj) => {
    localStorage.setItem("user",JSON.stringify(userObj));
}

const removeUser = () => {
    localStorage.removeItem("user");
}

export {
    getToken,
    setToken,
    removeToken,
    getUser,
    setUser,
    removeUser
}